package ioc04;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 * Author:shixiaojun@itany.com
 * Date:2022/3/4 14:47
 * Version:1.0-SNAPSHOT
 */
public class Test {

    public static void main(String[] args) throws SQLException {
//        SomeBean someBean = new SomeBean();
//        SomeBean someBean2 = new SomeBean(1,"admin");
//        SomeBean someBean3 = (SomeBean) ObjectFactory.getObject();
//        ObjectFactory factory = new ObjectFactory();
//        SomeBean someBean4 = (SomeBean) factory.getSomeBean();
        ApplicationContext ac = new ClassPathXmlApplicationContext("ioc04/spring.xml");
        SomeBean someBean2 = (SomeBean) ac.getBean("someBean2");
        System.out.println(someBean2);
    }

}
